# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-pycodestyle
_pkgname=pycodestyle
pkgver=2.7.0
pkgrel=2
pkgdesc='Python style guide checker.'
url='https://pypi.org/project/pycodestyle/#files'
arch=('any')
license=('MIT')
depends=('python2')
makedepends=('python2-setuptools')
replaces=('pep8-python2' 'python2-pep8')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('26502480e5855f0fd9378664ec813bb38dc2f8ac22e01767fc8bf75e52fa7a7691382fd4f6f1edaeb5f41d150ed71ee87e0d7f525bf06acbf4b3034cec3a227a')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/$_pkgname" "$pkgdir/usr/bin/${_pkgname}2"
}

